export const CELL = {
  x: 0,
  y: 0,
  fill: '#bebebe',
  width: 24,
  height: 24,
  margin: 1
}

export class Cell {
  // 初始化
  constructor(row, col) {
    this.config = JSON.parse(JSON.stringify(CELL))
    this.setPosition(row, col)
    this.id = `cell${this.row}-${this.col}`

    this.image = null
    this.rect = null
  }
  // 设置位置
  setPosition(row, col) {
    this.row = row // 行
    this.col = col // 排
    this.config.x = this.config.width * this.row + this.config.margin * (this.row + 1)
    this.config.y = this.config.height * this.col + this.config.margin * (this.col + 1)
    if (this.image) this.image.setPosition(this.config)
  }


}